package com.tvunetworks.center.user.controller.feign;

import com.tvunetworks.center.common.feign.GridFeignInterface;
import com.tvunetworks.center.common.model.dto.grid.AcceptedGrid;
import com.tvunetworks.center.common.model.param.GridStartLiveParam;
import com.tvunetworks.center.common.model.param.GridStopLiveParam;
import com.tvunetworks.center.common.util.Result;
import com.tvunetworks.center.user.service.GridService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @program:
 * @description:
 * @author HenryChen
 * @create: 11/27/2019 5:06 PM
 **/
@RestController
@RequestMapping("/feign/grid")
@Slf4j
public class GridFeignController implements GridFeignInterface {


    /**
     *
     * Grid Market 相关接口集合类
     *
     */
    @Autowired
    private GridService gridService;




    @Override
    public List<AcceptedGrid> getGridByUserId(@RequestParam String userId,@RequestParam String condition) throws Exception {
        return gridService.getGridByUserId(userId,condition);
    }

    @Override
    public Result gridStartLive(@RequestBody GridStartLiveParam param) throws Exception {
        return gridService.gridStartLive(param);
    }

    @Override
    public Result gridStopLive(@RequestBody GridStopLiveParam param) throws Exception {
        return gridService.gridStopLive(param);
    }


}
